/*------------------------------------------------------*/
/*                                                      */
/* Copyright (C)	sky-mobi.com                        */
/* All rights reserved                                  */
/*                                                      */
/* Author   tristan.yang                                */
/*                                                      */
/* History  2011-5-20 created                           */
/*                                                      */
/*------------------------------------------------------*/

#ifndef __TS_BASE_H__
#define __TS_BASE_H__

#include "vcsbase.h"
#include "tlv12.h"
#include "cvtlvdef.h"

typedef std::vector<LPVOID>		VoidpVec;
typedef CRtHashMapT<StringHashKey, VoidpVec> ChannelSubInfoMap;
typedef CRtHashMapT<StringHashKey, LPVOID>	ChannelMap;
typedef std::vector<CRtString>	ChannelVec;
typedef std::vector<LPVOID>		AudienceVec;
typedef std::map<DWORD, LPVOID>	AudienceMap;

#define STR_RCV_Body			"BODY"
#define STR_SSP_RCV             "RCV"
#define STR_SSP_SSPS            "SSPS"
#define STR_SDP_SUFFIX			".sdp"
#define SSP_BUF_SIZE			/*1024**/50

#define DATA_RECV_TIMEOUT			30*1000 //30s
#define SEND_DATA_TIMER_INTERVAL	20 //20ms
typedef enum 
{
	ST_INVALID = -1,
	
	//RTSP״̬
	RTSP_ANNOUNCE = 100,
	RTSP_SETUP,
	RTSP_PLAY,
	RTSP_PAUSE,
	RTSP_TEARDOWN,
	
	//HTTP״̬
	HTTP_POST = 200,
	HTTP_PUT,
	HTTP_GET,
	HTTP_MOVE,
	
	//LIVE״̬
	LIVE_INIT = 300,
	LIVE_SSP,
	LIVE_PLAY,
	LIVE_END
}Trans_Status;

//////////////////////////////////////////////////////////////////////////
//mgs' live programs info from xml config file
#define MG_CONFIG			"mg_config"
#define MG_PROGRAM_INFO		"mg_program_info"
#define MG_IP_INFO			"mg_ip"
#define MG_PORT_INFO		"mg_port"
#define MG_ENABLE			"mg_enable"
#define PROGRAM_INFO		"program_info"
#define PROGRAM_SOURCE		"p_source"
#define PROGRAM_NAME		"p_name"
//////////////////////////////////////////////////////////////////////////

struct st_MgProgram
{
	DWORD		m_dwRoomId;
	CRtString	m_strSource;
	CRtString	m_strName;
};
typedef std::vector<st_MgProgram>	VecProgram;
typedef CRtHashMapT<StringHashKey, VecProgram> MgProgramInfoMap;

typedef std::vector<st_MGstream>	VecStream;
struct st_ProgramDetail
{
	st_MgProgram	m_stProgram;
	LONGLONG		m_llLastRevTime;
	VecStream		m_vecStream;
	~st_ProgramDetail(){m_vecStream.clear();}
};
typedef CRtHashMapT<StringHashKey, st_ProgramDetail*> ProgramDetailMap;

#endif//__TS_BASE_H__
